home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kdeprint / kmjob.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.7 KB  |  131 lines

  1. /*
  2.  *  This file is part of the KDE libraries
  3.  *  Copyright (c) 2001 Michael Goffioul <kdeprint@swing.be>
  4.  *
  5.  *
  6.  *  This library is free software; you can redistribute it and/or
  7.  *  modify it under the terms of the GNU Library General Public
  8.  *  License version 2 as published by the Free Software Foundation.
  9.  *
  10.  *  This library is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.  *  Library General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU Library General Public License
  16.  *  along with this library; see the file COPYING.LIB.  If not, write to
  17.  *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.  *  Boston, MA 02110-1301, USA.
  19.  **/
  20.  
  21. #ifndef KMJOB_H
  22. #define KMJOB_H
  23.  
  24. #if !defined( _KDEPRINT_COMPILE ) && defined( __GNUC__ )
  25. #warning internal header, do not use except if you are a KDEPrint developer
  26. #endif
  27.  
  28. #include <qstring.h>
  29. #include <qvaluevector.h>
  30. #include <kdeprint/kmobject.h>
  31. #include <kdelibs_export.h>
  32.  
  33. /**
  34.  * @internal
  35.  * This class is internal to KDEPrint and is not intended to be
  36.  * used outside it. Please do not make use of this header, except
  37.  * if you're a KDEPrint developer. The API might change in the
  38.  * future and binary compatibility might be broken.
  39.  */
  40. class KDEPRINT_EXPORT KMJob : public KMObject
  41. {
  42. public:
  43.     enum JobAction {
  44.         Remove        = 0x01,
  45.         Move          = 0x02,
  46.         Hold          = 0x04,
  47.         Resume        = 0x08,
  48.         Restart       = 0x10,
  49.         ShowCompleted = 0x20,
  50.         All           = 0xFF
  51.     };
  52.     enum JobState {
  53.         Printing  = 1,
  54.         Queued    = 2,
  55.         Held      = 3,
  56.         Error     = 4,
  57.         Cancelled = 5,
  58.         Aborted   = 6,
  59.         Completed = 7,
  60.         Unknown   = 8
  61.     };
  62.     enum JobType {
  63.         System   = 0,
  64.         Threaded = 1
  65.     };
  66.  
  67.     KMJob();
  68.     KMJob(const KMJob& j);
  69.  
  70.     KMJob& operator=(const KMJob& j);
  71.     void copy(const KMJob& j);
  72.     QString pixmap();
  73.     QString stateString();
  74.     bool isCompleted() const        { return (m_state >= Cancelled && m_state <= Completed); }
  75.     bool isActive() const            { return !isCompleted(); }
  76.  
  77.     // inline access functions
  78.     int id() const                { return m_ID; }
  79.     void setId(int id)            { m_ID = id; }
  80.     const QString& name() const        { return m_name; }
  81.     void setName(const QString& s)        { m_name = s; }
  82.     const QString& printer() const        { return m_printer; }
  83.     void setPrinter(const QString& s)    { m_printer = s; }
  84.     const QString& owner() const        { return m_owner; }
  85.     void setOwner(const QString& s)        { m_owner = s; }
  86.     int state() const            { return m_state; }
  87.     void setState(int s)            { m_state = s; }
  88.     int size() const            { return m_size; }
  89.     void setSize(int s)            { m_size = s; }
  90.     const QString& uri() const        { return m_uri; }
  91.     void setUri(const QString& s)        { m_uri = s; }
  92.     int type() const            { return m_type; }
  93.     void setType(int t)            { m_type = t; }
  94.     int pages() const            { return m_pages; }
  95.     void setPages(int p)            { m_pages = p; };
  96.     int processedPages() const        { return m_processedpages; }
  97.     void setProcessedPages(int p)        { m_processedpages = p; }
  98.     int processedSize() const        { return m_processedsize; }
  99.     void setProcessedSize(int s)        { m_processedsize = s; }
  100.     bool isRemote() const        { return m_remote; }
  101.     void setRemote(bool on)        { m_remote = on; }
  102.  
  103.     QString attribute(int i) const    { return m_attributes[i]; }
  104.     void setAttribute(int i, const QString& att)    { m_attributes[i] = att; }
  105.     int attributeCount() const    { return m_attributes.size(); }
  106.     void setAttributeCount(int c)    { m_attributes.resize(c); }
  107.  
  108. protected:
  109.     void init();
  110.  
  111. protected:
  112.     // normal members
  113.     int    m_ID;
  114.     QString    m_name;
  115.     QString    m_printer;
  116.     QString    m_owner;
  117.     int    m_state;
  118.     int    m_size;
  119.     int    m_type;
  120.     int    m_pages;
  121.     int    m_processedsize;
  122.     int    m_processedpages;
  123.     bool    m_remote;
  124.  
  125.     // internal members
  126.     QString    m_uri;
  127.     QValueVector<QString>    m_attributes;
  128. };
  129.  
  130. #endif
  131.